$(function () {
    $('.navigationResults ul').hide();
    $('.navigationResults li a:first-child').click(function () {
        $(this).css({"color": "black"});
        $(this).siblings().toggle();
    })
})
$(function () {
    /*展示（基本信息）患者信息*/
    $.ajax({
        url: "../../QueryFieldAnnotations/selectPtientInformationSheet",
        type: "post",
        dataType: "json",
        success: function (map) {
            /**
             * 基本信息-患者信息
             */
            var spanStrPatient = "";
            var patient = map.patient;
            for (var i = 1; i < patient.length; i++) {
                if (patient[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = patient[i].column_comment.indexOf("（");
                    var indexEnd = patient[i].column_comment.lastIndexOf("）");
                    var columnComment = patient[i].column_comment.substring(indexState, indexEnd + 1);
                    spanStrPatient += "<li><input type='checkbox' id='patientRes" + i + "' name='xz' value='" + patient[i].columnName + "," + patient[i].column_comment.replace(columnComment, '') + "' /><label for='patientRes" + i + "'>" + patient[i].column_comment.replace(columnComment, '') + "</label></li>";
                }
            }
            $("#basic_results_patient_level1").append(spanStrPatient);
            /**
             * 基本信息-就诊费用
             */
            var spanStrCharge = "";
            var charge = map.charge;
            for (var i = 1; i < charge.length; i++) {
                if (charge[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = charge[i].column_comment.indexOf("（");
                    var indexEnd = charge[i].column_comment.lastIndexOf("）");
                    var columnComment = charge[i].column_comment.substring(indexState, indexEnd + 1);
                    spanStrCharge += "<li><input type='checkbox' id='chargeRes" + i + "' name='xz' value='" + charge[i].columnName + "," + charge[i].column_comment.replace(columnComment, '') + "' /><label for='chargeRes" + i + "'>" + charge[i].column_comment.replace(columnComment, '') + "</label></li>";
                }
            }
            $("#basic_results_doctor_cost_level1").append(spanStrCharge);
            /**
             * 基本信息-就诊信息
             */
            var spanStrDiagnosis = "";
            var diagnosis = map.diagnosis;
            for (var i = 1; i < diagnosis.length; i++) {
                if (diagnosis[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = diagnosis[i].column_comment.indexOf("（");
                    var indexEnd = diagnosis[i].column_comment.lastIndexOf("）");
                    var columnComment = diagnosis[i].column_comment.substring(indexState, indexEnd + 1);
                    spanStrDiagnosis += "<li><input type='checkbox' id='diagnosisRes" + i + "' name='xz' value='" + diagnosis[i].columnName + "," + diagnosis[i].column_comment.replace(columnComment, '') + "' /><label for='diagnosisRes" + i + "'>" + diagnosis[i].column_comment.replace(columnComment, '') + "</label></li>";
                }
            }
            $("#basic_results_doctor_level1").append(spanStrDiagnosis);
            /**
             * 临床检验-检验报告
             */
            var spanStrPathologicalReport = "";
            var pathologicalReport = map.pathologicalReport;
            for (var i = 1; i < pathologicalReport.length; i++) {
                if (pathologicalReport[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = pathologicalReport[i].column_comment.indexOf("（");
                    var indexEnd = pathologicalReport[i].column_comment.lastIndexOf("）");
                    var columnComment = pathologicalReport[i].column_comment.substring(indexState, indexEnd + 1);
                    spanStrPathologicalReport += "<li><input type='checkbox' id='pathologicalReportRes" + i + "' name='xz' value='" + pathologicalReport[i].columnName + "," + pathologicalReport[i].column_comment.replace(columnComment, '') + "' /><label for='pathologicalReportRes" + i + "'>" + pathologicalReport[i].column_comment.replace(columnComment, '') + "</label></li>";
                }
            }
            $("#basic_results_inspection_level1").append(spanStrPathologicalReport);
        }
    })
})
